#include<iostream>
#include<vector>
#include<unordered_set>
#include<string>

using namespace std;

bool isPowerOfTwo(int n) {
    if (n < 0) return false;
    int count = 0;
    while (n)
    {
        count += n & 1;
        n >>= 1;
    }
    if (count == 1) return true;
    return false;
}

int countDistinctIntegers(vector<int>& nums) {
    unordered_set<int> m;
    int res = 0;
    for (auto it : nums)
    {
        m.insert(it);
        string s = to_string(it);
        reverse(s.begin(), s.end());
        int rit = atoi(s.c_str());
        m.insert(rit);
    }
    return m.size();
}